package org.regotto.basics.dataStruct;

public class Queue {

    private int[] q = new int[1000];
    // h 队列头, t 队列尾
    private int h = 0, t = 0;

    public void I(int x) {
        q[t++] = x;
    }

    public void D() {
        h++;
    }

    public String E() {
        return h == t ? "empty" : "non-empty";
    }

    public int Q() {
        return q[h];
    }

    public static void main(String[] args) {
        Queue queue = new Queue();
        queue.I(1);
        queue.I(2);
        queue.I(3);
        System.out.println(queue.Q());
        System.out.println(queue.E());
        // 删除 1
        queue.D();
        System.out.println(queue.Q());
    }

}
